package com.wmx.main.text02;

/**
 * @author:wmx 2025-03-28 15:08
 * 1、功能:
 * 2、参数{
 * <p>
 * <p>
 * }
 **/
public class Calculate {
    public Calculate() {
    }
    public int getSum(@Sum(100) int n) throws Exception {
        if(n>1){
            int sum = 0;
            for (int i = 1; i < n; i++) {
                sum += i;
            }
            return  sum;
        }else{
            throw  new Exception("n小于或等于1");
        }
    }
}

